﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;

namespace FindPrimes
{
    class Program
    {
       
        public static ArrayList Find(int input)
        {
            ArrayList a = new ArrayList();
            for(int i = 2; i < input; i++)
            {
                while (input != i)
                {
                    if (input % i == 0)
                    {
                        a.Add(i);
                        input /= i;
                    }
                    else
                        break;
                }
            }
            a.Add(input);
            return a;
            
        }
        static void Main(string[] args)
        {
            Console.WriteLine("输入要分解质因数的数");
            int input = Convert.ToInt32(Console.ReadLine());
            ArrayList arrayList = Program.Find(input);
           /* for(int i = 0; i < arrayList.Count; i++)
            {
                Console.Write(arrayList[i]+" ");
            }*/
           foreach(int num in arrayList)
            {
                Console.Write(num + " ");
            }
        }
    }
}
